package com.acwebsitedesign.uRateDrugs.domain;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service("ReviewService")
public class ReviewServiceImpl implements ReviewService {
	
	@Autowired()
	private ReviewRepository reviewRepository;
	
	public List<Review> getReviewsForADrug(int drugId) {
		return reviewRepository.getReviewsForADrug(drugId);
	}

	public void saveReview(Review review) {
		reviewRepository.saveReview(review);
	}

	public void removeReview(int PId) {
		reviewRepository.removeReview(PId);
		
	}

	public void removeAllReviewsForAUser(int UId) {
		reviewRepository.removeAllReviewsForAUser(UId);
	}

	public List<Review> getAllReviewsFromAUser(int id) {
		return reviewRepository.getAllReviewsFromAUser(id);
	}

	public List<Review> getReviewWithId(Review review) {
		return reviewRepository.getReviewWithId(review);
	}

	public int getRating(int drugId) {
		return reviewRepository.getRating(drugId);
	}

}
